module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
   
    const AdminSchema = new Schema({
      userName: { type: String ,required:true,min:6,max:18,formate:/^[\u4e00-\u9fa5A-Za-z0-9_]{6,20}$/},
      passWord: { type: String ,required:true,min:6,max:18,formate:/^[A-Za-z0-9_]{6,20}$/},
      silenceTime:{type:Date,default:Date.now()},
      bannedTime:{type:Date,default:Date.now()},
      userPower:{type:Number,default:1},
      avatar:{type:String,default:"https://c-ssl.duitang.com/uploads/blog/202010/24/20201024181813_6cdfb.thumb.1000_0.jpg"},
      meta:{createAt:{type:Date,default:Date.now()}}
    });
    
    return mongoose.model('Admin', AdminSchema);
  }